package com.durian.finance.mapper;

import com.durian.financial.api.domain.FkBusinessCredit;
import com.durian.financial.api.domain.FkBusinessCreditSub;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 风控公寓授信主Mapper接口
 * 
 * @author durian
 * @date 2022-06-28
 */
public interface FkBusinessCreditMapper 
{
    /**
     * 查询风控公寓授信主
     * 
     * @param id 风控公寓授信主主键
     * @return 风控公寓授信主
     */
    public FkBusinessCredit selectFkBusinessCreditById(Long id);

    /**
     * 查询风控公寓授信主列表
     * 
     * @param fkBusinessCredit 风控公寓授信主
     * @return 风控公寓授信主集合
     */
    public List<FkBusinessCredit> selectFkBusinessCreditList(FkBusinessCredit fkBusinessCredit);

    /**
     * 新增风控公寓授信主
     * 
     * @param fkBusinessCredit 风控公寓授信主
     * @return 结果
     */
    public int insertFkBusinessCredit(FkBusinessCredit fkBusinessCredit);

    /**
     * 修改风控公寓授信主
     * 
     * @param fkBusinessCredit 风控公寓授信主
     * @return 结果
     */
    public int updateFkBusinessCredit(FkBusinessCredit fkBusinessCredit);

    /**
     * 删除风控公寓授信主
     * 
     * @param id 风控公寓授信主主键
     * @return 结果
     */
    public int deleteFkBusinessCreditById(Long id);

    /**
     * 批量删除风控公寓授信主
     * 
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteFkBusinessCreditByIds(Long[] ids);

    /**
     * 根据商户id获取 风控公寓授信对象
     *
     * @param businessId 商户id
     * @return FkBusinessCredit（风控公寓授信对象）
     */
    FkBusinessCredit getByBusinessId(Long businessId);

    /**
     * 根据商户id 和 金融产品id查询获取字表对象
     *
     * @param businessId
     * @param jrProductId
     * @return FkBusinessCreditSub
     */
    FkBusinessCreditSub getSubByBusinessIdAndProductId(@Param("businessId") Integer businessId, @Param("jrProductId") Integer jrProductId);



    /**
     * 修改风控公寓授信子
     *
     * @param fkBusinessCreditSub 风控公寓授信子
     * @return 结果
     */
    int updateFkBusinessCreditSub(FkBusinessCreditSub fkBusinessCreditSub);
}
